package com.doraro.platform.module.user.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.doraro.platform.common.beans.BaseEntity;
import com.doraro.platform.module.user.enums.SysMenuType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author doraro
 * @since 2019-05-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_menu")
@ApiModel(value = "SysMenu对象", description = "")
public class SysMenu extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "菜单 ID")
    @TableId(value = "menu_id", type = IdType.AUTO)
    private Integer menuId;

    private Integer parentId;

    @ApiModelProperty(value = "菜单名称")
    private String menuName;

    @ApiModelProperty(value = "菜单URL")
    private String url;

    @ApiModelProperty(value = "菜单类型(0-目录,1-导航菜单,2-功能按钮)")
    @NotNull
    private SysMenuType menuType;

    @ApiModelProperty(value = "排序")
    private Integer orderNum = 0;


    @ApiModelProperty(value = "图标")
    private String icon;

    @ApiModelProperty(value = "需要权限")
    private String perm;
    @ApiModelProperty(value = "前端组件")
    private String component = "#";

    @TableField(exist = false)
    @ApiModelProperty(value = "子菜单")
    private List<SysMenu> children;
}
